package ysq.xyg.shop.model.po;

import lombok.Data;
import lombok.NoArgsConstructor;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 商城模块-商品劵管理实体类
 *
 * @author congcong tao
 * @date 2019-4-28 11:19:33
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_shop_order_coupon")
public class ShopOrderCoupon implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 会员
     */ 
	@Column(name = "member_id")
	private String memberId;
	
	/**
     * 商品主键
     */ 
	@Column(name = "item_id")
	private String itemId;
	
	/**
     * 商品名称
     */ 
	@Column(name = "item_name")
	private String itemName;
	
	/**
     * 品牌名称
     */ 
	@Column(name = "brand_name")
	private String brandName;
	
	/**
     * 分类名称
     */ 
	@Column(name = "cat_name")
	private String catName;
	
	/**
     * 卷图片
     */ 
	@Column(name = "image")
	private String image;
	
	/**
     * 二维码图片
     */ 
	@Column(name = "qr_image")
	private String qrImage;
	
	/**
     * 券价格
     */ 
	@Column(name = "price")
	private String price;
	
	/**
     * 状态:1、待入库，2、已入库，3、已下架，4、已交易
     */ 
	@Column(name = "status")
	private String status;
	
	/**
     * 1、无纠纷，2、纠纷中，3、纠纷无效，4、纠纷有效
     */ 
	@Column(name = "issue_status")
	private String issueStatus;
	
	/**
     * 纠纷原因
     */ 
	@Column(name = "issue_message")
	private String issueMessage;
	
	/**
     * 上传时间
     */ 
	@Column(name = "upload_time")
	private Date uploadTime;
	
	/**
     * 处理时间
     */ 
	@Column(name = "manage_time")
	private Date manageTime;
	
	/**
     * 创建者
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 删除状态1、未删除2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 更新者
     */ 
	@Column(name = "update_user")
	private String updateUser;
	
	/**
     * 更新时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	@Transient
	private String memberNickName;

	@Transient
	private String memberName;

	@Transient
	private String memberPhone;

	public ShopOrderCoupon(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}